import 'package:bloc/bloc.dart';
import 'package:meta/meta.dart';

part 'glod_event.dart';
part 'glod_state.dart';

class GlodBloc extends Bloc<GlodEvent, GlodState> {
  GlodBloc() : super(GlodInitialState()) {
    on<GlodEvent>(_glodEventHandler);
  }

  void _glodEventHandler(GlodEvent event, Emitter<GlodState> emit) {
    if (event is GlodLoadingEvent) {
      emit(GlodLoading());
    } else if (event is GlodLoadingEvent) {
      emit(GlodLoading());
    } else if (event is GlodDismissedEvent) {
      emit(GlodDismissed());
    } else if (event is GlodSuccessEvent) {
      emit(GlodSuccessState(message: event.message));
    } else if (event is GlodEmptyEvent) {
      emit(GlodEmptyState(message: event.message));
    } else if (event is GlodErrorEvent) {
      emit(GlodErrorState(message: event.message));
    }
  }
}
